<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        n = 3
        var climbStairs = function(n) {
            var step1 = 1,step2 = 2,re = 0
            if(n==1||n==2){
                return n
            }
            while (n>2){
                re = step1+step2
                step1 = step2
                step2 = re
                n--
            }
            return re
        };
        console.log(climbStairs(n));

    </script>
</body>
</html>